<?php
/***************************************************************
*  Copyright notice
*  (c) 2009, jianyuzhu@gmail.com
*  All rights reserved
*  This script is part of the PPEMI project.
***************************************************************/

//PAGE TIME
define('PAGE_PARSE_START_TIME', microtime());
define('SYS_RT_CURRENT_TIME', time());

// set the level of error reporting
error_reporting(E_ALL & ~E_NOTICE);

// check if register_globals is enabled.
// since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.
//if( function_exists('ini_get') ) {
//	ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!');
//}

//config.php
define('CURRENT_FILE_DIRECTORY', dirname(__FILE__) . '/');
$CONFIG = array();
include_once(CURRENT_FILE_DIRECTORY . 'config/language.config.php');
include_once(CURRENT_FILE_DIRECTORY . 'config.php');
include_once(CURRENT_FILE_DIRECTORY . 'constants.php');

//Simple MySQL
include_once(CONFIG_PATH . CONFIG_DIR_CLASSES . 'database.mysql.class.php');
include_once(CONFIG_PATH . CONFIG_DIR_FUNCTIONS . 'database.function.php');
$adb = ADODBDatabase::getInstance();
$adb->connect();
if( CONFIG_DB_UTF8 == 'true' ) {
	$adb->query("SET NAMES 'utf8'");	
}

//utils
include_once(CONFIG_PATH . CONFIG_DIR_INCLUDES . 'utils.php');
//commons
include_once(CONFIG_PATH . CONFIG_DIR_INCLUDES . 'commons.php');
//core
include_once(CONFIG_PATH . CONFIG_DIR_INCLUDES . 'core.php');
//language
include_once(CONFIG_PATH . CONFIG_DIR_FUNCTIONS . 'language.function.php');
//$lang = 'en_us';
$tpl->register_block("translate", "func_lang_translation");
func_lang_dynamic_load_package('common');
//front
include_once(CONFIG_PATH . CONFIG_DIR_INCLUDES . 'fronts.php');
//
?>